<?php

namespace app\common\model\Subject;

use think\Model;
use traits\model\SoftDelete;

// 课程订单模型
class Order extends Model
{
    use SoftDelete;

    protected $name = 'subject_order';

    protected $autoWriteTimestamp = true;

    protected $createTime = 'createtime';

    protected $updateTime = false;
    
    protected $deleteTime = 'deletetime';

    // 联表查询课程信息
    public function subject()
    {
        return $this->belongsTo('app\common\model\Subject\Subject','subid', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    // 添加查询用户信息
    public function business()
    {
        return $this->belongsTo('app\common\model\Business\Business','busid', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}